﻿using Inovout.Gis;
using System.Collections.Specialized;
using Inovout.Gis.Geometry;
using ESRI.ArcGIS.esriSystem;

namespace Inovout.ArcGis
{
    public class ArcGisGisInfoRepositoryFactory : IGisInfoRepositoryFactory
    {
        public IGisInfoRepository CreateGisInfoRepository(NameValueCollection datasourceConfig)
        {
            IPropertySet propertySet = new PropertySetClass();
            propertySet.SetProperty("Server", datasourceConfig.Get("Server"));
            propertySet.SetProperty("Instance", datasourceConfig.Get("Instance"));
            propertySet.SetProperty("user", datasourceConfig.Get("user"));
            propertySet.SetProperty("password", datasourceConfig.Get("password"));
            propertySet.SetProperty("version", datasourceConfig.Get("version"));


            return new ArcGisInfoRepository(propertySet);
        }


    }
}
